<!--
 * @Author: hq
 * @Date: 2022-05-24 10:21:11
 * @LastEditors: hq
 * @LastEditTime: 2022-05-26 11:48:06
 * @Description: 编辑弹窗
 * @version: 1.0
-->
<template>
  <div class="dialog">
    <div class="content">
      <div class="row">
        <div class="col">
          <span class="red">*</span>
          身份名称：
        </div>
        <el-input v-model="identity" placeholder="请输入身份名称"></el-input>
      </div>
      <div class="row">
        <div class="col">
          <span class="red">*</span>
          是否开启：
        </div>
        <el-switch v-model="switchState" :active-color="$color - primary1">
        </el-switch>
      </div>
      <div class="row">
        <div class="col">权限：</div>
        <Tree></Tree>
      </div>
    </div>

    <div class="btn">
      <el-button type="primary" @click="handleSubmit">确 定</el-button>
    </div>
  </div>
</template>

<script>
import Tree from "@/components/tree.vue";
export default {
  components: { Tree },
  data() {
    return {
      identity: "",
      switchState: true,
    };
  },
  methods: {
    handleCancel() {
      this.$emit("handleClose");
    },
    handleSubmit() {
      this.$emit("handleClose");
    },
  },
};
</script>

<style lang="scss" scoped>
.dialog {
  padding: 0 20px;
  box-sizing: border-box;
  height: 100%;
  .content {
    height: 92%;
    overflow: auto;
    &::-webkit-scrollbar {
      width: 0;
    }
  }
  .row {
    display: flex;
    margin-bottom: 20px;
    .col {
      width: 100px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      flex-shrink: 0;
      margin-right: 10px;
    }
    .red {
      margin-right: 5px;
    }
  }
  .row:nth-child(3) {
    align-items: flex-start;
  }
  .el-input__inner {
    height: 36px;
    line-height: 36px;
  }
  .btn {
    box-sizing: border-box;
    .el-button {
      width: 100%;
    }
  }
}
</style>
